package com.hdd.demo.service.impl;

import com.hdd.demo.dao.UserDao;
import com.hdd.demo.entity.User;
import com.hdd.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public User get(int id) {
        User user = userDao.get(id);
        return user;
    }

    @Override
    public void update(User user) {
        userDao.update(user);
    }

    @Override
    public void delete(Integer id) {
        userDao.delete(id);
    }

    @Override
    public void add(User user) {
        userDao.add(user);
    }

    @Override
    public List<User> getAll() {
        List<User> list = userDao.getAll();
        return list;
    }
}
